home *** CD-ROM | disk | FTP | other *** search
/ Gurewich OLE Controls for Visual Basic 4 / Gurewich OLE Controls for Visual Basic 4.iso / ocxprog / programs / ch17 / myclock / myclock.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-27  |  1.9 KB  |  79 lines

  1. // myclock.cpp : Implementation of CMyclockApp and DLL registration.
  2.  
  3. #include "stdafx.h"
  4. #include "myclock.h"
  5.  
  6. #ifdef _DEBUG
  7. #undef THIS_FILE
  8. static char BASED_CODE THIS_FILE[] = __FILE__;
  9. #endif
  10.  
  11.  
  12. CMyclockApp NEAR theApp;
  13.  
  14. const GUID CDECL BASED_CODE _tlid =
  15.         { 0x85a87843, 0xd415, 0x101b, { 0x96, 0xe3, 0x0, 0x20, 0xaf, 0x38, 0xf4, 0xbb } };
  16. const WORD _wVerMajor = 1;
  17. const WORD _wVerMinor = 0;
  18.  
  19.  
  20. ////////////////////////////////////////////////////////////////////////////
  21. // CMyclockApp::InitInstance - DLL initialization
  22.  
  23. BOOL CMyclockApp::InitInstance()
  24. {
  25.     BOOL bInit = COleControlModule::InitInstance();
  26.  
  27.     if (bInit)
  28.     {
  29.         // TODO: Add your own module initialization code here.
  30.     }
  31.  
  32.     return bInit;
  33. }
  34.  
  35.  
  36. ////////////////////////////////////////////////////////////////////////////
  37. // CMyclockApp::ExitInstance - DLL termination
  38.  
  39. int CMyclockApp::ExitInstance()
  40. {
  41.     // TODO: Add your own module termination code here.
  42.  
  43.     return COleControlModule::ExitInstance();
  44. }
  45.  
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DllRegisterServer - Adds entries to the system registry
  49.  
  50. STDAPI DllRegisterServer(void)
  51. {
  52.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  53.  
  54.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  55.         return ResultFromScode(SELFREG_E_TYPELIB);
  56.  
  57.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  58.         return ResultFromScode(SELFREG_E_CLASS);
  59.  
  60.     return NOERROR;
  61. }
  62.  
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // DllUnregisterServer - Removes entries from the system registry
  66.  
  67. STDAPI DllUnregisterServer(void)
  68. {
  69.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  70.  
  71.     if (!AfxOleUnregisterTypeLib(_tlid))
  72.         return ResultFromScode(SELFREG_E_TYPELIB);
  73.  
  74.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  75.         return ResultFromScode(SELFREG_E_CLASS);
  76.  
  77.     return NOERROR;
  78. }
  79.